#include<bits/stdc++.h>
using namespace std;

struct po{
    int x,y;
};

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int n,m;
    cin>>n>>m;
    n++;
    m++;
    int dis1=(n+1)/2;
    int dis2=(m+1)/2;
    vector<vector<int> >g(dis1*2+1,vector<int>(dis2*2+1,0));
    for(int i=1;i<=(n+1)/2;i++){
        for(int j=1;j<=(m+1)/2;j++){
            po dian1={i,j};
            for(int i1=1;i1<=n;i1++){
                for(int j1=1;j1<=m;j1++){
                    if(i1==i&&j1==j)continue;
                    po dian2={i1,j1};
                    int x=dian2.x-dian1.x;
                    int y=dian2.y-dian1.y;
                    if(dian1.x+y>=1&&dian1.x+y<=n&&dian1.y+x>=1&&dian1.y+x<=m){
                        if(dian2.x+y>=1&&dian2.x+y<=n&&dian2.y+x>=1&&dian2.y+x<=m){
                            g[i][j]++;
                        }
                    }
                    if(dian1.x-y>=1&&dian1.x-y<=n&&dian1.y-x>=1&&dian1.y-x<=m){
                        if(dian2.x-y>=1&&dian2.x-y<=n&&dian2.y-x>=1&&dian2.y-x<=m){
                            g[i][j]++;
                        }
                    }
                }
            }
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cout<<g[i][j]/2<<' ';
        }
        cout<<'\n';
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(i<=(n+1)/2&&j<=(m+1)/2)continue;
            if(i>=(n+1)/2+1&&j<=(m+1)/2){
                g[i][j]=g[dis1*2+1-i][j];
            }
            if(i<=(n+1)/2&&j>=(m+1)/2+1){
                g[i][j]=g[i][dis2*2+1-j];
            }
            if(i>=(n+1)/2+1&&j>=(m+1)/2+1){
                g[i][j]=g[dis1*2+1-i][dis2*2+1-j];
            }
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cout<<g[i][j]/2<<' ';
        }
        cout<<'\n';
    }
    return 0;
}